bitkeeper revision 1.1159.258.132 (428900ceGeeOt2WYcJ01WZMZCdJCHA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 16 May 2005 20:21:34 +0000 (20:21 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 16 May 2005 20:21:34 +0000 (20:21 +0000)
Fix multi-page I/O accesses in the blkback driver in cases where we
receive partial-completion callbacks.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c

index 375377b138d396270b91d4d5266028b7b97ea4d4..dc15b20180d696782d809a2e2a2f1fe742a47182 100644 (file)
@@ -252,8 +252,9 @@ static void end_block_io_op(struct buffer_head *bh, int uptodate)
 #else
 static int end_block_io_op(struct bio *bio, unsigned int done, int error)
 {
-    if ( done || error )
-        __end_block_io_op(bio->bi_private, (done && !error));
+    if ( bio->bi_size != 0 )
+        return 1;
+    __end_block_io_op(bio->bi_private, !error);
     bio_put(bio);
     return error;
 }